/*
* @Author: Srain
* @Date:   2018-07-25 14:46:32
* @Last Modified by:   Srain 
* @Last Modified time: 2018-09-29 14:38:06
*/


require('./index.css');
require('page/common/nav/index.js');

var _mm             = require('util/mm.js');
var _new            = require('service/new-service.js');
var templateIndex   = require('./index.string');

// page 逻辑部分
var page = {
	data : {
        id : _mm.getUrlParam('id') || '',
    },
    init: function(){
        this.onLoad();
    },
    onLoad : function(){
        // 加载新闻信息
        this.loadDetail();
    },
    // 加载新闻信息
    loadDetail : function(){
        var newHtml = '';
        _new.getNewDetail(this.data.id,function(res){
            newHtml = _mm.renderHtml(templateIndex, res);
            $('.panel').html(newHtml);
        }, function(errMsg){
            _mm.errorTips(errMsg);
        });
    }
};
$(function(){
    page.init();
});